#include "bs.h"
#include "hr_time.h"
#include "bs_kernel.cuh"
//#define DEBUG 

#ifdef DEBUG
void print_arr(BS_test_t * t, cl_float *arr);
#endif

double launch_BS(BS_test_t *t)
{
		CStopWatch tim;

		tim.startTimer();
		BlackScholesGPU<<<t->gridSize / t->blockSize, t->blockSize>>>(
			t->d_CallResult, t->d_PutResult, t->d_StockPrice, t->d_OptionStrike,
			t->d_OptionYears, t->Riskfree, t->Volatility, t->num);
		cutilCheckMsg("BlackScholesGPU() execution failed\n");

		cutilSafeCall(cudaThreadSynchronize());
		tim.stopTimer();

		return tim.getElapsedTime();
}
